package server.handler;

import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.handler.codec.http.HttpObjectAggregator;
import io.netty.handler.codec.http.HttpServerCodec;

/**
 * @author Lyoto
 * @Description
 * @Date 2022-11-20 13:12
 * @Version
 **/
public class WebsocketChannelInitializer<C extends Channel> extends ChannelInitializer<C> {
    
    @Override
    protected void initChannel(C c) {
        c.pipeline()
         .addLast(new HttpServerCodec());
        c.pipeline().addLast(new HttpObjectAggregator(65536));
        c.pipeline().addLast(new WebsocketChannelHandler());
    }
    
}
